package com.lace.ctrl.admin.web.company.controller;

//import org.springframework.security.authentication.BadCredentialsException;
import com.lace.waf.exception.BadRequestException;
import com.lace.waf.exception.ServiceException;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Administrator on 2018/7/10.
 */
@RestController
@RequestMapping("/v1/exception")
public class ExceptionController {


    @RequestMapping("err1")
    public String errorTest(){
        throw new ServiceException("3333","service异常");
    }

    @RequestMapping("err2")
    public String errorTest2(){
        throw new RuntimeException("运行时异常");
    }

    @RequestMapping("err3")
    public String errorTest3(){
        throw new BadRequestException("请求不合法");
    }

    @RequestMapping("err4")
    public String errorTest4(){
        int a = 1/0;
        return "";
    }

    @RequestMapping("err5")
    public String errorTest5(){
        String a = null;
        a.split(",");
        return "";
    }

}
